using ClassDemo.Model.Entity;


namespace ClassDemo.Repository;

/// <summary>
/// 教师Repository接口
/// </summary>
public interface ITeacherRepository : IBaseRepository<Teacher>
{
    /// <summary>
    /// 根据姓名查询教师列表
    /// </summary>
    /// <param name="name">教师姓名</param>
    /// <returns>教师列表</returns>
    Task<List<Teacher>> GetByNameAsync(string name);

    /// <summary>
    /// 根据手机号查询教师
    /// </summary>
    /// <param name="mobile">手机号</param>
    /// <returns>教师信息</returns>
    Task<Teacher?> GetByMobileAsync(string mobile);

    /// <summary>
    /// 检查手机号是否已存在
    /// </summary>
    /// <param name="mobile">手机号</param>
    /// <param name="excludeId">排除的教师ID（用于更新时检查）</param>
    /// <returns>是否存在</returns>
    Task<bool> IsMobileExistsAsync(string mobile, int? excludeId = null);
}